import {Entity} from "../../entity";
import {Alias, Column, Editor, Serialize} from "../../decorator";

//角色（G表）
export class Group extends Entity{

    @Editor("String")
    @Alias("角色名称")
    @Serialize("name")
    public name: string = "";

    @Editor("Memo")
    @Alias("角色描述")
    @Serialize("description")
    public description: string = "";

    @Serialize("modules")
    public modules: any = [];

    constructor() {
        super();
    }

    fromJSON(obj) {
        super.fromJSON(obj);
    }

    clone(): any {
        const entity: any = super.clone();
        entity.modules = [...this.modules];
        return entity;
    }

    copy(entity: any) {
        super.copy(entity);
        this.modules = [...entity.modules];
    }
}


